<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网站后台管理系统</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="icon" href="/static/hadmin/img/logo.png" type="image/x-icon">
    <link rel="shortcut icon" href="favicon.ico"> <link href="/static/hadmin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <script src="/static/admin/js/city/jquery-1.11.3.min.js"></script>

    <!-- 全局/static/admin//static/admin//static/admin/js -->
    <script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- 自定义js -->
    <script src="/static/admin/js/content.js?v=1.0.0"></script>
    <!-- jQuery Validation plugin javascript-->
    <!-- <script src="/static/admin/js/plugins/validate/jquery.validate.min.js"></script>-->
    <!--<script src="/static/admin/js/plugins/validate/messages_zh.min.js"></script>-->
    <!--<script src="/static/admin/js/demo/form-validate-demo.js"></script>-->
    <script src="/static/admin/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>

    <!--script src="/static/admin/layer/layer.css"></script>-->
    <script src="/static/admin/layer/layer.js"></script>
    <style>
        .form-group{height: 60px;}
        .control-label{margin-top: 20px;}
        .col-sm-2 input{ width: 300px; height: 20px;}
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>修改密码</h5>
                    </div>

                </div>
            </div>
        </div>

                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="cliet-form" action="" method="post" onsubmit="return subForm()"  enctype="multipart/form-data" >
                            <div class="form-group">
                                <label class="col-sm-1 control-label">账号：</label>
                                <div class="col-sm-2" >
                                        <input id="username" name="username"  class="form-control" type="text" required=""  value="{$username}" readonly>
                                  <!--  <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请输入公司名称</span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">旧密码：</label>
                                <div class="col-sm-2">
                                    <input id="password"  class="form-control" type="password" aria-required="true" aria-invalid="false" class="valid" required name="password" value="">
                                   <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请输入公司账号</span>-->
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">新密码：</label>
                                <div class="col-sm-2">
                                    <input id="new_password" class="form-control" type="password" required="" name="new_password" value="">
                                   <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请输入您的密码</span>-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">确认密码：</label>
                                <div class="col-sm-2">
                                    <input id="confirm_new_password"  class="form-control" type="password" required="" value="">
                                   <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>-->
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-8 col-sm-offset-3">
                                    <button class="btn btn-primary" type="submit" >提交</button>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <script src="/static/admin/js/city/area.js"></script>
    <script src="/static/admin/js/city/select.js"></script>

    <script  type="text/javascript">

        function subForm(){
            var data =[];
            var password = $("#password").val();
            var new_password = $("#new_password").val();
            var confirm_new_password =$("#confirm_new_password").val();

            if(new_password !== confirm_new_password ){
                layer.msg('两次密码不一致');
                return false;
            }
            var data ={
                password:password,
                new_password:new_password,
            };
            $.ajax({
                url:"/mobile.php/main/subEditcode",
                data:data,
                type:"post",
                dataType:'json',

                success:function(res){
                    if(1==res.code) {
                        layer.msg(res.msg);
                        setTimeout(function(){
                            window.location.reload();
                        },1000)
                    }else{
                        layer.msg(res.msg);
                        return false;
                    }
                },
                error:function(){
                    layer.msg('系统错误');
                    return false;
                },

            })
            return false;
        }

    </script>
</body>


</html>
